<%--@elvariable id="REJECT" type="java.lang"--%>
<%--@elvariable id="PAST" type="java.lang"--%>
<%--@elvariable id="id" type="java.lang"--%>
<%--@elvariable id="note" type="com.genghis.ptas.note.entity.Note"--%>
<%--
  Created by IntelliJ IDEA.
  User: gaoyang
  Date: 14-4-28
  Time: 下午3:33
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <%@include file="../../../includes/common.jsp" %>
    <title>审核笔记</title>
</head>
<body>
<div id="mainContent">
    <form class="form-horizontal" action="">
        <fieldset>
            <legend></legend>
            <div class="control-group">
                <label class="control-label" for="noteName">笔记名称</label>

                <div class="controls">
                    <input id="noteName" name="noteName" type="text" value="${note.noteName}">
                </div>
            </div>
            <div class="control-group">
                <label class="control-label" for="userName">公示者姓名</label>

                <div class="controls">
                    <input id="userName" name="userName" type="text" value="${note.userName}">
                </div>
            </div>
            <div class="control-group">
                <label class="control-label" for="noteType">笔记类型</label>

                <div class="controls">
                    <input id="noteType" name="noteType" type="text" value="${note.noteType}">
                </div>
            </div>
            <div class="control-group">
                <label class="control-label" for="noteContent"></label>

                <div class="controls">
                    <textarea class="textarea" id="noteContent" name="noteContent" cols="300"
                              rows="">${note.noteContent}</textarea>
                </div>
            </div>
            <div class="controls">
                <input type="button" id="past" class="btn btn-primary" onclick="pasting()" value="通过"/>
                <input type="button" id="reject" class="btn btn-primary" onclick="rejecting()" value="驳回"/>
                <input type="button" onclick="quit()" class="btn btn-primary" value="取消"/>
            </div>
        </fieldset>
    </form>
</div>
</body>
</html>
<script type="text/javascript">

    function audit(state, operate) {
        $.messager.confirm("提示", "确认" + operate + "？", function (r) {
            if (r) {
                $.ajax({
                    url: basePath + "note/publicity/auditNote?ids=${id}&state=" + state,
                    dataType: "json",
                    type: "DELETE",
                    success: function () {
                        $.messager.alert("成功", "已审核成功！", "", function () {
                            parent.$("#dataEdit").dialog('close');
                            parent.query();
                        })
                    },
                    error: doError
                })
            }
        })
    }

    function pasting() {
        audit("${PAST}", "通过");
    }

    function rejecting() {
        audit("${REJECT}", "驳回");
    }

    function quit() {
        parent.$("#dataEdit").dialog('close');
    }
</script>